﻿#!/usr/bin/python3
# -*- coding:utf-8 -*-
from django.urls import path
from .views import MdView
from .views import ExcelView
from .views import DocView

urlpatterns = [
    # fileList
    path('fileList/', DocView.FileList.as_view(), name="fileList"),   # post切换子目录，获取目录列表
    path('createFile/', DocView.createFile, name='createFile'),       # 新建文件
    path('deleteFile/', DocView.deleteFile, name="deleteFile"),       # 删除文件
    path('deleteDir/', DocView.deleteDir, name="deleteDir"),          # 删除目录
    path('getDirList/', DocView.getDirList, name="query_files"),      # 获取左侧的目录列表，返回模板。已废弃
    # ---fileList:移动文件----
    path('getSpaceDirsList/', DocView.getSpaceDirsList, name="getSpaceDirsList"),   # 获取目录下的文件列表信息，右侧
    path('moveFile/', DocView.moveFile, name="moveFile"),                   # 移动文件
    path('uploadFileDiv/', DocView.uploadFileDiv, name='uploadFileDiv'),    # 上传文件
    path('uploadExcel/', DocView.uploadExcel, name='uploadExcel'),          # 上传Excel文件
    path('uploadFile/', DocView.UploadFile.as_view(), name="uploadFile"),   # uploadFile，已经废弃

    # markdown
    path('userExit/', MdView.userExit, name="userExit"),              # 用户注销，并且mdfiles删除cur_editor
    path('getSpaceList/', MdView.getSpaceList, name="getSpaceList"),
    path('get_filelist/', MdView.get_filelist, name="get_filelist"),  # 获取目录写的文件列表
    path('editor/', MdView.Editor.as_view(), name="edit_markdown"),
    path('exitEditor/', MdView.exitEditor, name="exitEditor"),
    path('uploadImage/', MdView.uploadImage, name="uploadImage"),
    path('modify_markdown/', MdView.modify_markdown, name="modify_markdown"),    # 保存markdown文档
    # view
    path('view_markdown/', MdView.view_markdown, name="view_markdown"),
    # test
    path('query_config/', MdView.query_config),



    # luckysheet -- 不能协同编辑，已放弃
    path('sheet/', ExcelView.EditExcel.as_view(), name='edit_excel'),
    path('saveSheet/', ExcelView.saveSheet, name='saveSheet'),
    path('queryEditor/', ExcelView.queryEditor, name='queryEditor'),

    #  查看官网demo
    path('sheet/viewDemo/', ExcelView.viewDemo, name='viewDemo'),

    # sheetEdit -- 支持协同编辑
    path('sheetEdit/', ExcelView.LuckySheetLoadUrl.as_view(), name='sheetEdit'),
    path('saveSheetData/', ExcelView.LuckySheetSaveDb.as_view(), name='saveSheetData'),
    path('getExcelData/', ExcelView.getExcelData, name='getExcelData'),

    # redis
    path('setRedis/', ExcelView.setRedis, name='setRedis'),
    path('getRedis/', ExcelView.getRedis, name='getRedis'),
    path('actRedis/', ExcelView.actRedis, name='actRedis'),

]